package bytes;public class ByteTest {    public static void main(String[] args) throws Exception{        String str1 = "hello";        String str2 = "你好abc";        System.out.println("utf-8编码下'hello'所占的字节数:" + str1.getBytes("utf-8").length);        System.out.println("gbk编码下'hello'所占的字节数:" + str1.getBytes("gbk").length);        System.out.println("utf-8编码下'你好abc'所占的字节数:" + str2.getBytes("utf-8").length);        System.out.println("gbk编码下你好'你好abc'所占的字节数:" + str2.getBytes("gbk").length);        System.out.println("========================================");        String s = "{\"basic\":{\"requestPlatform\":\"Mac OS\",\"requestIp\":\"localhost\",\"requestOperator\":\"愣头青\"},\"body\":{\"requestPlatform\":\"OS\",\"requestIp\":\"11\",\"requestOperator\":\"铁头哇\"}}";        System.out.println(s.getBytes("utf-8").length);    }}